chrome.runtime.onInstalled.addListener(function() {
    chrome.storage.sync.set({color: '#3aa757'}, function() {
      console.log("The color is green.");
      location.href = 'http://www.baidu.com';
    });

		chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
      chrome.declarativeContent.onPageChanged.addRules([{
        conditions: [new chrome.declarativeContent.PageStateMatcher({
          pageUrl: {hostEquals: 'wap.haikr.com.cn'},
        })
        ],
            actions: [new chrome.declarativeContent.ShowPageAction()]
      }]);
    });

});

chrome.webRequest.onBeforeRequest.addListener(
  function(details) { 
    return {cancel: true}; 
  },
  {urls: ["https://www.baidu.com"]},
  ["blocking"]
);